[##include file="common/header.tpl.php"##]
[##include file="common/nav.tpl.php"##]


<div id="main">
	<p>
  <form id="porp_form" name="porp_form" method="post">
      <table class="form_table">
     	<tr>
        	<td>
            	游戏名称：
            </td>
            <td>
            	<select onchange=changeselect1(this.value) name="game" >
                  <option value="0">请选择</option>
                  <option value="app_factory_prop" [##if $game == 'app_factory_prop'##]selected="selected"[##/if##]>疯狂工厂</option>
                  <option value="app_kingdoms_prop" [##if $game == 'app_kingdoms_prop'##]selected="selected"[##/if##]>三国夫人</option>
                  <option value="app_showhand_prop" [##if $game == 'app_showhand_prop'##]selected="selected"[##/if##]>梭哈</option>
                  <option value="app_mora_prop" [##if $game == 'app_mora_prop'##]selected="selected"[##/if##]>猜拳</option>
                  <option value="app_21_prop" [##if $game == 'app_21_prop'##]selected="selected"[##/if##]>21点</option>
        		</select>
            </td>
        </tr>
        <tr>
            <td>
            	道具类型：
            </td>
            <td>
            	<select name="prop" >
                  <option selected value="0">请选择</option>
                  [##if !empty($list.type)##]
                  <option value="[##$list.type##]" selected="selected">		                     [##$type[$list.type]##]
                  </option>
                  [##/if##]
                </select>
            </td>
       	</tr>
        <tr>
            <td>
            	名称：
            </td>
            <td>
            	<input type="text" name="name" value="[##if !empty($list)##][##$list.name##][##/if##]"> 
            </td>
       	</tr>
         <tr>
            <td>
            	价格：
            </td>
            <td>
            	<input type="text" name="price" value="[##if !empty($list)##][##$list.price##][##/if##]"> 金币消耗数量
            </td>
       	</tr>
        <tr>
            <td>
            	数值：
            </td>
            <td>
            	<input type="text" name="num" value="[##if !empty($list)##][##$list.harm##][##/if##]">如:加血、加体力、加攻击</td>
       	</tr>
        <tr>
            <td>
            	描述：
            </td>
            <td>
            	<textarea name="content" id="content" style="width:600px; height:100px;">[##if !empty($list)##][##$list.introduce##][##/if##]</textarea>
            </td>
       	</tr>
      </table>
      <input type="reset" value="重置">&nbsp;&nbsp;&nbsp;<input type="button" id="prop_submit" value="提交"/><br />
      [##if !empty($list.id)##]<input type="hidden" name="id" value="[##$list.id##]" />[##/if##]
  </form>
	</p>
</div>
<script type="text/javascript">
// 绑定表单提交事件
$('#prop_submit').click(function(id) {
	var submit_url = '[##$adminurl##]/?m=material&a=addprop';
	
	$.post(submit_url , $('#porp_form').serialize() , function(d) {
		if(d.code) return alert(d.msg);

		alert(d.msg);
		javascript:history.go(-1);
		//window.location.href = '?m=kingdomslady&a=mapalter';
	} , 'json');

});
var subcat = new Array();
subcat[0] = new Array('app_factory_prop','体力','hp')

subcat[1] = new Array('app_kingdoms_prop','疗伤','hp')
subcat[2] = new Array('app_kingdoms_prop','攻击','ap')
subcat[3] = new Array('app_kingdoms_prop','盗窃','steal')
subcat[4] = new Array('app_kingdoms_prop','防盗','guard')
subcat[5] = new Array('app_kingdoms_prop','勤奋','diligent')
subcat[6] = new Array('app_kingdoms_prop','特殊','special')
subcat[7] = new Array('app_showhand_prop','穿透','perspective')
subcat[8] = new Array('app_showhand_prop','隐身','dormant')
subcat[9] = new Array('app_showhand_prop','随机','random')
subcat[10] = new Array('app_mora_prop','重开','repeat')
subcat[11] = new Array('app_21_prop','重开','repeat')
function changeselect1(locationid)
{
	document.porp_form.prop.length = 0; //初始化下拉列表 清空下拉数据
	document.porp_form.prop.options[0] = new Option('请选择',''); //给第一个值
	if(locationid.value == 2){
		
		}
	for (i=0; i<subcat.length; i++) //legth=20
	{
	if (subcat[i][0] == locationid) //[0] [1] 第一列 第二列
	{document.porp_form.prop.options[document.porp_form.prop.length] = new Option(subcat[i][1], subcat[i][2]);}
}
}
</script>
[##include file="common/footer.tpl.php"##]